home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / demo / sound / UP-EP003.lha / ep-install / EP-Installer < prev    next >
Text File  |  1980-01-20  |  11KB  |  394 lines

  1.  
  2. ;$VER: Up Rough EP Install-script 1.0 (9-Jul-00) ©2000 Up Rough Soundsystem
  3.  
  4. ;****************************************************************************************
  5. ;*                                   File Information                                   *
  6. ;*======================================================================================*
  7. ;*                                                                                      *
  8. ;*         Installation script used to copy/update UPEP main files and copy EPs.        *
  9. ;*                                                                                      *
  10. ;*==========+=============+=============================================================*
  11. ;* YY/MM/DD |     Who     |                          Description                        *
  12. ;*==========+=============+=============================================================*
  13. ;* 00/06/06 |   Nemonic   | Copied some strings from the ver SPOT had edited ;)         *
  14. ;*----------+-------------+-------------------------------------------------------------*
  15. ;* 00/05/26 |   Nemonic   | Libraries...NEWWpA8...UPEPFont...bla bla...yada yada..      *
  16. ;*----------+-------------+-------------------------------------------------------------*
  17. ;* 00/05/12 |   Nemonic   | Lots of UPEP* changed to EP*.                               *
  18. ;*----------+-------------+-------------------------------------------------------------*
  19. ;* 00/05/02 |   Nemonic   | Got somtn that works pretty good.                           *
  20. ;****************************************************************************************
  21.  
  22. (user 2)            ; User must be expert...even if the user in question isn't one ;p
  23.  
  24. ;****************************************************************************************
  25. ;*                                    Error handling                                    *
  26. ;****************************************************************************************
  27.  
  28. (onerror
  29.  
  30.     (if (> @ioerr 0)
  31.         (
  32.             (message
  33.  
  34.                 ((cat "An error has occurred during installation.\n"
  35.                       "Please check the log file to understand the error."))
  36.             )
  37.         )
  38.     )
  39.  
  40.     (exit (quiet))
  41. )
  42.  
  43. ;****************************************************************************************
  44. ;*                       Check if we are running under correct OS                       *
  45. ;****************************************************************************************
  46.  
  47. (welcome)
  48.  
  49. (if (< (/ (getversion) 65536) 39)
  50.     (
  51.         (abort "Incorrect OS version (software requires OS 39 or better)!")
  52.     )
  53. )
  54.  
  55. ;****************************************************************************************
  56. ;*                            Set the destination directory                             *
  57. ;****************************************************************************************
  58.  
  59. (if (exists "EP:" (NOREQ))
  60.     (
  61.         ; The assign EP: exists...user must have a previous installation
  62.  
  63.         (set @default-dest (getassign "EP"))
  64.         (set previnstall 1)
  65.     )
  66.     ; ELSE
  67.     (
  68.         ; EP: doesn't exist...ask user if there is a previous installation
  69.  
  70.         (set previnstall
  71.             (askbool
  72.  
  73.                 (prompt (cat "Couldn't find the EP: assign!\n"
  74.                              "Have ya got a previous installation of Up Rough EP on your HD?"))
  75.  
  76.                 (help @askbool-help)
  77.  
  78.                 (choices
  79.  
  80.                     "Yea"
  81.                     "No"
  82.                 )
  83.  
  84.                 (default 1)
  85.             )
  86.         )
  87.                 (copyfiles
  88.  
  89.                     (source "Fonts/")
  90.  
  91.                     (dest "FONTS:")
  92.  
  93.                     (all)
  94.  
  95.                     (optional "fail")
  96.                 )
  97.         (if (= previnstall 1)
  98.             (
  99.                 ; User answered yes to that question
  100.                 ; Now he/she have 2 specify where its installed
  101.  
  102.                 (set @default-dest
  103.  
  104.                     (askdir
  105.  
  106.                         (prompt "Then show me where ya got it:")
  107.  
  108.                         (help @askdir-help)
  109.  
  110.                         (default @default-dest)
  111.                     )
  112.                 )
  113.             )            
  114.         )
  115.     )
  116. )
  117.  
  118. ;****************************************************************************************
  119. ;*  If first install, create all needed dirs and copy the icons...and some other stuff  *
  120. ;****************************************************************************************
  121.  
  122. (if (= previnstall 0)
  123.     (
  124.         ; Ask where user want UPEP installed
  125.  
  126.         (set @default-dest
  127.  
  128.             (askdir
  129.  
  130.                 (prompt "Where do ya want da EP to be installed (a drawer will be created):")
  131.  
  132.                 (help @askdir-help)
  133.  
  134.                 (default @default-dest)
  135.             )
  136.         )
  137.  
  138.         ; Create all directories
  139.  
  140.         (makedir (tackon @default-dest "UpRoughEP"))
  141.         (makedir (tackon @default-dest "UpRoughEP/Data"))
  142.         (makedir (tackon @default-dest "UPRoughEP/EPs"))
  143.  
  144.         ; Set @default-dest to our newly created directory
  145.  
  146.         (set @default-dest (tackon @default-dest "UpRoughEP"))
  147.  
  148.         ; Let the user select what type of icons to use
  149.  
  150.         (set icontype
  151.  
  152.             (askchoice
  153.  
  154.                 (prompt "What type of icons do ya wanna use?")
  155.  
  156.                 (help @askchoice-help)
  157.  
  158.                 (choices
  159.  
  160.                     "OS3.5"
  161.                     "Old style"
  162.                 )
  163.  
  164.                 (default 1)
  165.             )
  166.         )
  167.  
  168.         ; Copy the icons
  169.  
  170.         (copyfiles
  171.  
  172.             (source (tackon "Icons/" (select icontype "3.5" "Old")))
  173.  
  174.             (dest @default-dest)
  175.  
  176.             (pattern "#?.info")
  177.  
  178.             (optional "fail")
  179.         )
  180.  
  181.         ; Copy the font, some libraries and C: commands
  182.  
  183.         (set copythis
  184.  
  185.             (askoptions
  186.  
  187.                 (prompt (cat "Select what stuff to copy to your SYS: partition...\n"
  188.                              "The ones that are checked as default are requiered!!!"))
  189.  
  190.                 (help @askoptions-help)
  191.  
  192.                 (choices
  193.  
  194.                     "UPEPFont (FONTS:)"
  195.                     "dbplayer.library V2.0 (LIBS:)"
  196.                     "ptreplay.library V6.6 (LIBS:)"
  197.                     "NewWPA8 V1.4 (C:) (for AGA users!)"
  198.                 )                
  199.  
  200.                 (default 7)
  201.             )
  202.         )
  203.  
  204.         (set showdocstxt 0)
  205.         (set docstxt "See the Docs/ dir for more info on...\n\n")
  206.  
  207.         (if (BITAND copythis 1)  ; Copy the font?
  208.             (
  209.                 (copyfiles
  210.  
  211.                     (source "Fonts/")
  212.  
  213.                     (dest "FONTS:")
  214.  
  215.                     (all)
  216.  
  217.                     (optional "fail")
  218.                 )
  219.             )
  220.         )
  221.  
  222.         (if (BITAND copythis 2)  ; Copy dbplayer.library?
  223.             (
  224.                 (copylib
  225.  
  226.                     (prompt "dbplayer.library...")
  227.  
  228.                     (help @copylib-help)
  229.  
  230.                     (source "Libs/dbplayer.library")
  231.  
  232.                     (dest "LIBS:")
  233.  
  234.                     (optional "force" "askuser")
  235.  
  236.                     (confirm "expert")
  237.                 )
  238.  
  239.                 (set showdocstxt 1)
  240.                 (set docstxt (cat docstxt "dbplayer.library (whole arc. avail. on aminet)\n"))
  241.             )
  242.         )
  243.  
  244.         (if (BITAND copythis 4)  ; Copy ptreplay.library?
  245.             (
  246.                 (copylib
  247.  
  248.                     (prompt "ptreplay.library...")
  249.  
  250.                     (help @copylib-help)
  251.  
  252.                     (source "Libs/ptreplay.library")
  253.  
  254.                     (dest "LIBS:")
  255.  
  256.                     (optional "force" "askuser")
  257.  
  258.                     (confirm "expert")
  259.                 )
  260.  
  261.                 (set showdocstxt 1)
  262.                 (set docstxt (cat docstxt "ptreplay.library (whole arc. avail. on aminet)\n"))
  263.             )            
  264.         )
  265.  
  266.         (if (BITAND copythis 8)  ; Copy NewWPA8?
  267.             (
  268.                 (copyfiles
  269.  
  270.                     (source "C/NewWPA8")
  271.  
  272.                     (dest "C:")
  273.  
  274.                     (optional "fail")
  275.                 )
  276.  
  277.                 (set showdocstxt 1)
  278.                 (set docstxt (cat docstxt "NewWPA8 (whole arc. avail. on aminet)\n"))
  279.             )
  280.         )
  281.  
  282.         (if (= showdocstxt 1)
  283.             (
  284.                 (message (docstxt))
  285.             )
  286.         )
  287.  
  288.         ; Ask if EP: should be added 2 user-startup...and add it if wanted
  289.  
  290.         (startup "UpRoughEP"
  291.  
  292.             (prompt (cat "Do you want the line\n\n"
  293.                          "assign EP: \"" @default-dest "\"\n"
  294.                          "\nto be added to your \"s:user-startup\" file?\n"
  295.                          "Since you SHOULD use the enclosed scripts to start EP "
  296.                          "(where the assign is taken care of) there is no need to "
  297.                          "add this line to your user-startup. But it's up to you. "
  298.                          "If you don't want it added then select \"Skip this part\"."))
  299.  
  300.             (help @startup-help)
  301.  
  302.             (command "Assign EP: \"" @default-dest "\"\n")
  303.         )
  304.     )
  305. )
  306.  
  307. ;****************************************************************************************
  308. ;*                              Copy/Update the main files                              *
  309. ;****************************************************************************************
  310.  
  311. ; A little procedure to make version copying easier...really should be a built in
  312. ; function that did the same (I dont wanna use copylib for ordinary files)....BAH!
  313.  
  314. (procedure upepvercpy #srcfile
  315.     (
  316.         (set upepvcpyfile 1)
  317.  
  318.         (if (exists (tackon @default-dest #srcfile) (NOREQ))
  319.             (
  320.                 (if (<= (getversion #srcfile) (getversion (tackon @default-dest #srcfile)))
  321.                     (
  322.                         ; The new file isn't newer than the old
  323.  
  324.                         (set upepvcpyfile 0)
  325.                     )
  326.                 )
  327.             )
  328.         )
  329.  
  330.         (if (= upepvcpyfile 1)
  331.             (
  332.                 (copyfiles
  333.  
  334.                     (source #srcfile)
  335.  
  336.                     (dest @default-dest)
  337.  
  338.                     (optional "fail")
  339.                 )
  340.             )
  341.         )
  342.     )
  343. )
  344.  
  345. ; Copy/Update EP, EP.guide, Prefs, PrefsMUI and Start
  346.  
  347. (upepvercpy "EP")
  348. (upepvercpy "EP.guide")
  349. (upepvercpy "Prefs")
  350. (upepvercpy "PrefsMUI")
  351. (upepvercpy "Start")
  352.  
  353. ; Copy Data/EPLogo.up and Data/EPLogoPal.up
  354.  
  355. (copyfiles
  356.  
  357.     (source "Data/")
  358.  
  359.     (dest (tackon @default-dest "Data"))
  360.  
  361.     (choices "LogoPal.up" "Logo.up")
  362.  
  363.     (optional "fail")
  364. )
  365.  
  366.  
  367. ;****************************************************************************************
  368. ;*                  Let the user choose the EPs to copy...then copy em                  *
  369. ;****************************************************************************************
  370.  
  371. (copyfiles
  372.  
  373.     (prompt "Select EP(s) to install this time...")
  374.  
  375.     (source "EPs/")
  376.  
  377.     (dest (tackon @default-dest "EPs"))
  378.  
  379.     (help @copyfiles-help)
  380.  
  381.     (all)
  382.  
  383.     (confirm "expert")
  384.  
  385.     (optional "fail")
  386. )
  387.  
  388. ;****************************************************************************************
  389. ;*                                         Exit                                         *
  390. ;****************************************************************************************
  391.  
  392. (exit)
  393.  
  394.